#ifndef _LPTIM32_H_
#define _LPTIM32_H_

#include "fm33lc0xx.h"
#include "fm33lc0xx_fl.h"

#define SYSTEM_COUNTER_MAX  (UINT32_MAX)

typedef enum{
	LPTIM32_RUNSTOP = 0,
	LPTIM32_RUNSTART = 1,
}LPTIM32_RunStateTypeDef;

typedef struct{
	uint32_t MsCount;
	union{
		uint32_t AllBit;
		struct{
			uint32_t MsFlag :1;
		}Bit;
	}Flag;
}LPTIM32_InfoTypeDef;

extern LPTIM32_InfoTypeDef LPTIM32_Info;

void LPTIM32_InitConfig(void);
void LPTIM32_NVIC_InitConfig(void);
void LPTIM32_Control(LPTIM32_RunStateTypeDef state);
uint32_t CalculateInterval(uint32_t current_tick, uint32_t previous_tick);
#endif //!_LPTIM32_H_
